
import { type IComponentConfig, ChannelEnum } from '../../types'
import { sizes } from '../util'

const props: IComponentConfig[] = [{
  type: 'switch',
  component: 'eSwitch',
  label: '是否禁用',
  model: 'disabled',
  defaultValue: false
}, {
  type: 'select',
  component: 'eSelect',
  label: 'true/false-value类型',
  model: 'type',
  props: {
    dataSource: {
      type: 'static',
      value: [{
        option_key: 'number',
        option_desc: 'Number'
      }, {
        option_key: 'boolean',
        option_desc: 'Boolean'
      }]
    },
    transfer: true
  },
  defaultValue: 'boolean'
}, {
  type: 'select',
  component: 'eSelect',
  label: '尺寸',
  model: 'size',
  props: {
    transfer: true,
    dataSource: {
      type: 'static',
      value: sizes
    }
  },
  defaultValue: 'default'
}]

const events: IComponentConfig[] = [{
  type: 'codeEditor',
  component: 'CodeEditor',
  label: 'onChange',
  model: 'on-change',
  defaultValue: `function fn() {
  
}`
}]

const slots: IComponentConfig[] = []

const drag = {
  compName: 'eSwitch',
  label: '开关',
  classify: {
    label: '基础',
    value: 'basic'
  },
  channel: ChannelEnum.PC,
  group: {
    label: '表单',
    value: 'form'
  },
  icon: 'icon-toggleon'
}

export default {
  drag,
  props,
  events,
  slots
}
